package com.dns.reset.web.repository;

import com.dns.reset.web.model.DbDnsEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface DbDnsRepository extends JpaRepository<DbDnsEntity,String> {
    @Query(value = "select MAX(no) FROM db_dns",nativeQuery = true)
    public Integer findMaxNo();
    @Query(value = "update db_dns set is_new=0",nativeQuery = true)
    @Modifying
    public Integer updateIsNew();

    public List<DbDnsEntity> findByIsNew(Integer isNew);
}
